import { Devcloud } from "../apiClass"
import { IResult } from "../../plugins/Interfaces"


export class DefalutResourceApi extends Devcloud {
  private baseUrl: string = this.path + 'defalutResource/';
  async page(param: any): Promise<IResult> {
    const resp = await this.client.post(this.baseUrl + "page", param)
    return resp.data
  }
  async list(param: any): Promise<IResult> {
    const resp = await this.client.post(this.baseUrl + "list", param)
    return resp.data
  }
  async insert(param: any): Promise<IResult> {
    const resp = await this.client.post(this.baseUrl + "insert", param)
    return resp.data
  }
  async update(param: any): Promise<IResult> {
    const resp = await this.client.post(this.baseUrl + "update", param)
    return resp.data
  }
  async delete(id: string): Promise<IResult> {
  const resp = await this.client.get(this.baseUrl + "delete", {"id": id})
  return resp.data
  }
  async get(id: string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "get", {"id": id})
    return resp.data
  }
}